package com.github.base.dto.permission;

import com.github.base.global.Const;
import com.github.base.validated.Update;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @program: base
 * @description: 权限DTO
 * @author: hui.zhang
 * @date: 2021/1/27 5:11 下午
 **/

@Data
public class PermissionDTO {

    @NotNull(message = "id不能为空", groups = Update.class)
    @Schema(description = "修改时传id")
    private Long id;

    @Schema(description = "父id 不传则为0 根节点")
    private Long parentId = 0L;

    @Schema(description = "权限类型 不传默认为菜单 1-菜单 2-按钮", example = "1")
    private Integer permissionType = Const.MENU;

    @NotBlank(message = "名称不能为空")
    @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED)
    private String permissionName;

    @Schema(description = "路由")
    private String menuUrl;

    @Schema(description = "权限编码")
    private String permissionCode;

}
